Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sticky balancer: try for better topic distribution among members #602

Merged
merged 1 commit into from
Oct 22, 2023

Conversation

twmb
Copy link
Owner

@twmb twmb commented Oct 21, 2023

The sticky balancer currently strives for ultimate stickiness, with no regard to trying to balance topic partitions among members equally. When adding a member, it is often the case that an entire topic's partitions shifts to the other member, while the first member has the other topic.

By sorting by partition number before balancing, when the algorithm steals partitions from the end of an existing member to give to the new member, we ensure that we divvy up the topics equally to both members while still ensuring stickiness.

This is likely not perfect but it goes a long way.

The sticky balancer currently strives for ultimate stickiness, with no
regard to trying to balance topic partitions among members equally. When
adding a member, it is often the case that an entire topic's partitions
shifts to the other member, while the first member has the other topic.

By sorting by partition number before balancing, when the algorithm
steals partitions from the end of an existing member to give to the new
member, we ensure that we divvy up the topics equally to both members
while still ensuring stickiness.

This is likely not perfect but it goes a long way.
@twmb twmb merged commit e94230f into master Oct 22, 2023
6 checks passed
@twmb twmb deleted the sticky-move branch October 22, 2023 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant